package com.zjy.springbootinit.entity;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

@Component
@ConfigurationProperties(prefix = "consumer1")
public class Consumer {
    @Value("${consumer1.username}")
    private  String username;
    @Value("${consumer1.age}")
    private int age;
    @Value("${consumer1.aihao}")
    private String[] aihao;
    @Value("${consumer1.subject}")
    private List<String> subject;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String[] getAihao() {
        return aihao;
    }

    public void setAihao(String[] aihao) {
        this.aihao = aihao;
    }

    public List<String> getSubject() {
        return subject;
    }

    public void setSubject(List<String> subject) {
        this.subject = subject;
    }

    @Override
    public String toString() {
        return "Consumer{" +
                "username='" + username + '\'' +
                ", age=" + age +
                ", aihao=" + Arrays.toString(aihao) +
                ", subject=" + subject +
                '}';
    }
}
